﻿Module MyExtensions

    Public Delegate Sub controldelegate()
    <System.Runtime.CompilerServices.Extension()>
    Public Sub InvokeIfNecessary(ByVal c As Control, ByVal d As controldelegate)
        If (c.InvokeRequired) Then
            c.Invoke(d)
        Else
            d()
        End If
    End Sub

End Module
